#include <func.h>

void function(int signum,siginfo_t *p,void *p1)
{
    printf("i am sleeping\n");
    sleep(3);
    sigset_t pend;
    sigpending(&pend);
    if(sigismember(&pend,SIGQUIT))
    {
        printf("sig %d is suspended\n");
    }
}

int main()
{
    struct sigaction act;
    bzero (&act,sizeof(act));
    act.sa_sigaction=function;
    act.sa_flags=SA_SIGINFO;
    sigemptyset(&act.sa_mask);
    sigaddset(&act.sa_mask,SIGQUIT);
    int ret=sigaction(SIGINT,&act,NULL);
    ERROR_CHECK(ret,-1,"sigaction");
    while(1);
    return 0;
}   